<?php
namespace Admin\Controller;
use Think\Controller;
class CheckController extends BaseController {
   public function checkList(){
        $trainModel=M('train');
		$train=$trainModel->where('tr_state=0')->order('tr_id desc')->join("club_info on train.club_id=club_info.club_id")->select(); //查询
		$this->train=$train; //volist name
		$this->display();
}
 public function checktrain(){
        // dump($_GET);
        $trainModel=D('train');
        $tr_id=$_GET['id'];
        $data['tr_state']=1;
      if (false !== $trainModel->where("tr_id=$tr_id")->save($data)){
                 echo $trainModel->getLastSql();
                $this->success('操作成功！');
    }
}
public function unchecktrain(){   
  $trainModel=D('train');
        $tr_id=$_GET['id'];
        $data['tr_state']=2;
      if (false !== $trainModel->where("tr_id=$tr_id")->save($data)){
                 echo $trainModel->getLastSql();
                $this->success('操作成功！');
        }//register end
    }
     public function mastercheckList(){    
       $masterModel=M('club_master');
        $master=$masterModel->where('club_master_audit=0')->order('club_master_id desc')->join("club_info on club_master.club_id=club_info.club_id")->select(); //查询
        $this->master=$master; //volist name
        $this->display();
        }//register end
public function checkmaster(){    
   $masterModel=D('club_master');
        $master_id=$_GET['id'];
        $data['club_master_audit']=1;
      if (false !== $masterModel->where("club_master_id=$master_id")->save($data)){
                 echo $masterModel->getLastSql();
                $this->success('操作成功！');
    }
        }

public function uncheckmaster(){    
   $masterModel=D('club_master');
        $master_id=$_GET['id'];
        $data['club_master_audit']=2;
      if (false !== $masterModel->where("club_master_id=$master_id")->save($data)){
                 echo $masterModel->getLastSql();
                $this->success('操作成功！');
    }
        }
public function lessoncheckList(){    
       $lessonModel=M('club_lesson');
        $lesson=$lessonModel->where('club_lesson_state=0')->order('club_lesson_id desc')->join("club_info on club_lesson.club_id=club_info.club_id")->select(); //查询
        $this->lesson=$lesson;
        $this->display();
        }//register end
public function checklesson(){    
   $lessonModel=D('club_lesson');
        $lesson_id=$_GET['id'];
        $data['club_lesson_state']=1;
      if (false !== $lessonModel->where("club_lesson_id=$lesson_id")->save($data)){
                 echo $lessonModel->getLastSql();
                $this->success('操作成功！');
    }
        }
public function unchecklesson(){    
   $lessonModel=D('club_lesson');
        $lesson_id=$_GET['id'];
        $data['club_lesson_state']=2;
      if (false !== $lessonModel->where("club_lesson_id=$master_id")->save($data)){
                 echo $lessonModel->getLastSql();
                $this->success('操作成功！');
    }
        }
}